Full source code website bán hàng thương mại điện tử gần giống shopee
467.551 lượt xem;
1 <? if(!session_id()) session_start(); ?>
2 <? require("../system/model/config.php") ?>
3 <? require("../system/model/common_start.php") ?>
4 <?
5 if (isset($_POST['butSub'])) {
6
7 $user = isset($_POST['txtUser']) && is_string($_POST['txtUser']) ? mysql_real_escape_string($_POST['txtUser']) : null;
8 $passcheck = isset($_POST['txtPwd']) && is_string($_POST['txtPwd']) && is_string($_POST['txtPwd']) ? mysql_real_escape_string($_POST['txtPwd']) : null;
9 $pass = ( md5(md5(md5( md5(md5(md5( mysql_real_escape_string($passcheck))))))));
10 $sql = "select * from user_nhanvien where user='".$user."' and pass='".$pass."' limit 1";
11 $bang=mysql_query($sql);
12 $xuat=mysql_fetch_array($bang);
13 $level=$xuat['level_shop'];
14 if($user!==$xuat['user'] or $pass!==$xuat['pass'])
15 {
16 $err="Tên đăng nhập hoặc mật khẩu không đúng";
17 }
18 elseif (mysql_num_rows(mysql_query($sql,$con))>0)
19 {
20 $quyen=$level;
21 $log=$user;
22 $_SESSION['nhanvien']=$user;
23 $_SESSION['level']=$level;
24 echo "<script>window.location='/nhanvien'</script>";
25
26 }
27 else
28 {
29 }
30 }
31 ?>
32 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
33 <html xmlns="http://www.w3.org/1999/xhtml">
34 <head>
35 <meta http-equiv="Content-Language" content="en-us" />
36 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
37 <title>Đăng nhập hệ thống </title>
38 <link type="image/x-icon" href="images/favico.ico" rel="shortcut icon"/>
39 <link rel="stylesheet" href="css/Login2.css" type="text/css" />
40
41
42
43 </head>
44
45 <body>
46 <form method="post" name="FormLoaiSP" >
47 <div class="container">
48 <div class="top">
49 <h1 id="title" class="hidden"><span id="logo"><span>Hello, wish you success</span></span></h1>
50 </div>
51 <div class="login-box animated fadeInUp">
52 <div class="box-header">
53 <h2>Quản Trị Hệ Thống</h2>
54 </div>
55 <center> <font color="red" style="
56 font-size: 14px;
57 "><b>
58 <?
59 if ($err!='')
60 {
61 echo $err;
62 }
63 ?></b></font></center>
64 <label for="username">Tên tài khoản</label>
65
66 <input name="txtUser" type="text" id="username">
67 <br>
68 <label for="password" style="margin-left: 28px;">Mật khẩu</label>
69
70 <input name="txtPwd" type="password" id="password">
71
72 <button id="login" type="submit" name="butSub">Đăng nhập</button>
73
74
75
76 </div>
77 </div>
78 </body>
79
80
81
82
83
84 </form>
85
86
87
88
89
90
91
92
93 <? require("../system/model/common_end.php") ?>
2 <? require("../system/model/config.php") ?>
3 <? require("../system/model/common_start.php") ?>
4 <?
5 if (isset($_POST['butSub'])) {
6
7 $user = isset($_POST['txtUser']) && is_string($_POST['txtUser']) ? mysql_real_escape_string($_POST['txtUser']) : null;
8 $passcheck = isset($_POST['txtPwd']) && is_string($_POST['txtPwd']) && is_string($_POST['txtPwd']) ? mysql_real_escape_string($_POST['txtPwd']) : null;
9 $pass = ( md5(md5(md5( md5(md5(md5( mysql_real_escape_string($passcheck))))))));
10 $sql = "select * from user_nhanvien where user='".$user."' and pass='".$pass."' limit 1";
11 $bang=mysql_query($sql);
12 $xuat=mysql_fetch_array($bang);
13 $level=$xuat['level_shop'];
14 if($user!==$xuat['user'] or $pass!==$xuat['pass'])
15 {
16 $err="Tên đăng nhập hoặc mật khẩu không đúng";
17 }
18 elseif (mysql_num_rows(mysql_query($sql,$con))>0)
19 {
20 $quyen=$level;
21 $log=$user;
22 $_SESSION['nhanvien']=$user;
23 $_SESSION['level']=$level;
24 echo "<script>window.location='/nhanvien'</script>";
25
26 }
27 else
28 {
29 }
30 }
31 ?>
32 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
33 <html xmlns="http://www.w3.org/1999/xhtml">
34 <head>
35 <meta http-equiv="Content-Language" content="en-us" />
36 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
37 <title>Đăng nhập hệ thống </title>
38 <link type="image/x-icon" href="images/favico.ico" rel="shortcut icon"/>
39 <link rel="stylesheet" href="css/Login2.css" type="text/css" />
40
41
42
43 </head>
44
45 <body>
46 <form method="post" name="FormLoaiSP" >
47 <div class="container">
48 <div class="top">
49 <h1 id="title" class="hidden"><span id="logo"><span>Hello, wish you success</span></span></h1>
50 </div>
51 <div class="login-box animated fadeInUp">
52 <div class="box-header">
53 <h2>Quản Trị Hệ Thống</h2>
54 </div>
55 <center> <font color="red" style="
56 font-size: 14px;
57 "><b>
58 <?
59 if ($err!='')
60 {
61 echo $err;
62 }
63 ?></b></font></center>
64 <label for="username">Tên tài khoản</label>
65
66 <input name="txtUser" type="text" id="username">
67 <br>
68 <label for="password" style="margin-left: 28px;">Mật khẩu</label>
69
70 <input name="txtPwd" type="password" id="password">
71
72 <button id="login" type="submit" name="butSub">Đăng nhập</button>
73
74
75
76 </div>
77 </div>
78 </body>
79
80
81
82
83
84 </form>
85
86
87
88
89
90
91
92
93 <? require("../system/model/common_end.php") ?>